package com.zhentao.pojo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 
 * @TableName scenes
 */
@TableName(value ="scenes")
@Data
public class Scenes implements Serializable {
    /**
     * 场景id
     */
    @TableId
    private Integer scenesId;

    /**
     * 场景名字
     */
    private String scenesName;

    /**
     * 用户id
     */
    private Integer userId;

    /**
     * 0 关闭,1 启动
     */
    private Integer state;


    /**
     * 场景描述
     */
    private String miaoshu;

    /**
     * 执行时间
     */
    @JsonFormat(pattern = "hh:mm:ss")
    private Date zhixingshijain;

    /**
     * 结束时间
     */
    @JsonFormat(pattern = "hh:mm:ss")
    private Date jieshushijian;


    @TableField(exist = false)
    List<Devices> devices;

    @TableField(exist = false)
    List<Chufatiaojian> chufatioajians;

    @TableField(exist = false)
    String name;

    @TableField(exist = false)
    List<Integer> id;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;




    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Scenes other = (Scenes) that;
        return (this.getScenesId() == null ? other.getScenesId() == null : this.getScenesId().equals(other.getScenesId()))
            && (this.getScenesName() == null ? other.getScenesName() == null : this.getScenesName().equals(other.getScenesName()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getScenesId() == null) ? 0 : getScenesId().hashCode());
        result = prime * result + ((getScenesName() == null) ? 0 : getScenesName().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getState() == null) ? 0 : getState().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", scenesId=").append(scenesId);
        sb.append(", scenesName=").append(scenesName);
        sb.append(", userId=").append(userId);
        sb.append(", state=").append(state);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append(", id=").append(id);
        sb.append(", name=").append(name);
        sb.append("]");
        return sb.toString();
    }
}